package cn.gson.fengboot.model.pojos;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Collection;
import java.util.Objects;

@Entity
@Table(name = "tfyclient_form", schema = "springboot", catalog = "")
public class TfyclientForm {
    private Integer clientId;//客户ID
    private Timestamp updateTime;//客户更新时间
    private String clientIndustry;//客户行业
    private String clientSource;//客户来源
    private String clientUrl;//客户网址
    private Timestamp establishPerson;//客户下次联系时间
    private Timestamp establishTime;//客户创建时间
    private String clientName;//公司名称
    private String clientRank;//客户级别
    private String clientPhone;//客户电话号码
    private String clientMobile;//客户手机号码
    private String clientSite;//客户公司地址
    private String clientSitexq;//客户公司地址详情
    private String clientRemark;//客户备注
    private String clientPeople;//客户的负责员工
    private String clientCjpeople;//客户创建人
    private int clientState;//删除客户状态
    private int clientIffollowup;//是否跟进状态
    private String clientSheng;//省
    private String clientSz;//地址的数字
    private QempFrom empId;//员工表
    private String clientPayattention;//加关注
    private String clientKhzt;//客户潜在，签约，重复状态
    private Collection<Tfyempoperation> operationId;
    private Collection<TfyrelationwarnFrom> relationwarnId;
    private Collection<TfylinkmanForm> tfylinkmanFormsByClientId;
    private Collection<Zbarter> zbartersByClientId;
    private Collection<Zcontract> zcontractsByClientId;
    private Collection<Zdeliverylog> zdeliverylogsByClientId;
    private Collection<Zinvoice> zinvoicesByClientId;
    private Collection<Zorder> zordersByClientId;


    @Id
    @Column(name = "client_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "seq")
    public Integer getClientId() {
        return clientId;
    }

    public void setClientId(Integer clientId) {
        this.clientId = clientId;
    }

    //客户多对员工一
    @ManyToOne
    @JoinColumn(name="emp_id")
    public QempFrom getEmpId() {
        return empId;
    }

    public void setEmpId(QempFrom empId) {
        this.empId = empId;
    }

    @Basic
    @Column(name = "client_khzt")
    public String getClientKhzt() {
        return clientKhzt;
    }

    public void setClientKhzt(String clientKhzt) {
        this.clientKhzt = clientKhzt;
    }

    @Basic
    @Column(name = "client_payattention")
    public String getClientPayattention() {
        return clientPayattention;
    }

    public void setClientPayattention(String clientPayattention) {
        this.clientPayattention = clientPayattention;
    }

    @Basic
    @Column(name = "client_sz")
    public String getClientSz() {
        return clientSz;
    }

    public void setClientSz(String clientSz) {
        this.clientSz = clientSz;
    }


    @Basic
    @Column(name = "client_sheng")
    public String getClientSheng() {
        return clientSheng;
    }

    public void setClientSheng(String clientSheng) {
        this.clientSheng = clientSheng;
    }

    @Basic
    @Column(name = "update_time")
    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "client_industry")
    public String getClientIndustry() {
        return clientIndustry;
    }

    public void setClientIndustry(String clientIndustry) {
        this.clientIndustry = clientIndustry;
    }

    @Basic
    @Column(name = "client_source")
    public String getClientSource() {
        return clientSource;
    }

    public void setClientSource(String clientSource) {
        this.clientSource = clientSource;
    }

    @Basic
    @Column(name = "client_url")
    public String getClientUrl() {
        return clientUrl;
    }

    public void setClientUrl(String clientUrl) {
        this.clientUrl = clientUrl;
    }

    @Basic
    @Column(name = "establish_person")
    public Timestamp getEstablishPerson() {
        return establishPerson;
    }

    public void setEstablishPerson(Timestamp establishPerson) {
        this.establishPerson = establishPerson;
    }

    @Basic
    @Column(name = "establish_time")
    public Timestamp getEstablishTime() {
        return establishTime;
    }

    public void setEstablishTime(Timestamp establishTime) {
        this.establishTime = establishTime;
    }

    @Basic
    @Column(name = "client_name")
    public String getClientName() {
        return clientName;
    }

    public void setClientName(String clientName) {
        this.clientName = clientName;
    }

    @Basic
    @Column(name = "client_rank")
    public String getClientRank() {
        return clientRank;
    }

    public void setClientRank(String clientRank) {
        this.clientRank = clientRank;
    }

    @Basic
    @Column(name = "client_phone")
    public String getClientPhone() {
        return clientPhone;
    }

    public void setClientPhone(String clientPhone) {
        this.clientPhone = clientPhone;
    }

    @Basic
    @Column(name = "client_mobile")
    public String getClientMobile() {
        return clientMobile;
    }

    public void setClientMobile(String clientMobile) {
        this.clientMobile = clientMobile;
    }

    @Basic
    @Column(name = "client_site")
    public String getClientSite() {
        return clientSite;
    }

    public void setClientSite(String clientSite) {
        this.clientSite = clientSite;
    }

    @Basic
    @Column(name = "client_sitexq")
    public String getClientSitexq() {
        return clientSitexq;
    }

    public void setClientSitexq(String clientSitexq) {
        this.clientSitexq = clientSitexq;
    }

    @Basic
    @Column(name = "client_remark")
    public String getClientRemark() {
        return clientRemark;
    }

    public void setClientRemark(String clientRemark) {
        this.clientRemark = clientRemark;
    }

    @Basic
    @Column(name = "client_people")
    public String getClientPeople() {
        return clientPeople;
    }

    public void setClientPeople(String clientPeople) {
        this.clientPeople = clientPeople;
    }

    @Basic
    @Column(name = "client_cjpeople")
    public String getClientCjpeople() {
        return clientCjpeople;
    }

    public void setClientCjpeople(String clientCjpeople) {
        this.clientCjpeople = clientCjpeople;
    }

    @Basic
    @Column(name = "client_state")
    public int getClientState() {
        return clientState;
    }

    public void setClientState(int clientState) {
        this.clientState = clientState;
    }

    @Basic
    @Column(name = "client_iffollowup")
    public int getClientIffollowup() {
        return clientIffollowup;
    }

    public void setClientIffollowup(int clientIffollowup) {
        this.clientIffollowup = clientIffollowup;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TfyclientForm that = (TfyclientForm) o;
        return clientId == that.clientId &&
                Objects.equals(updateTime, that.updateTime) &&
                Objects.equals(clientIndustry, that.clientIndustry) &&
                Objects.equals(clientSource, that.clientSource) &&
                Objects.equals(clientUrl, that.clientUrl) &&
                Objects.equals(establishPerson, that.establishPerson) &&
                Objects.equals(establishTime, that.establishTime) &&
                Objects.equals(clientName, that.clientName) &&
                Objects.equals(clientRank, that.clientRank) &&
                Objects.equals(clientMobile, that.clientMobile) &&
                Objects.equals(clientSite, that.clientSite) &&
                Objects.equals(clientRemark, that.clientRemark) &&
                Objects.equals(clientPeople, that.clientPeople) &&
                Objects.equals(clientCjpeople, that.clientCjpeople);
    }

    @Override
    public int hashCode() {
        return Objects.hash(clientId, updateTime, clientIndustry, clientSource, clientUrl, establishPerson, establishTime, clientName, clientRank, clientMobile, clientSite, clientRemark, clientPeople, clientCjpeople);
    }

    //客户一对联系提醒多
    @OneToMany(mappedBy = "clientId")
    public Collection<TfyrelationwarnFrom> getRelationwarnId() {
        return relationwarnId;
    }

    public void setRelationwarnId(Collection<TfyrelationwarnFrom> relationwarnId) {
        this.relationwarnId = relationwarnId;
    }

    //客户一对联系人多
    @OneToMany(mappedBy = "clientId")
    public Collection<TfylinkmanForm> getTfylinkmanFormsByClientId() {
        return tfylinkmanFormsByClientId;
    }

    public void setTfylinkmanFormsByClientId(Collection<TfylinkmanForm> tfylinkmanFormsByClientId) {
        this.tfylinkmanFormsByClientId = tfylinkmanFormsByClientId;
    }

    //客户一对操作多
    @OneToMany(mappedBy = "clientId")
    public Collection<Tfyempoperation> getOperationId() {
        return operationId;
    }

    public void setOperationId(Collection<Tfyempoperation> operationId) {
        this.operationId = operationId;
    }

    @OneToMany(mappedBy = "clientId")
    public Collection<Zbarter> getZbartersByClientId() {
        return zbartersByClientId;
    }

    public void setZbartersByClientId(Collection<Zbarter> zbartersByClientId) {
        this.zbartersByClientId = zbartersByClientId;
    }

    @OneToMany(mappedBy = "clientId")
    public Collection<Zcontract> getZcontractsByClientId() {
        return zcontractsByClientId;
    }

    public void setZcontractsByClientId(Collection<Zcontract> zcontractsByClientId) {
        this.zcontractsByClientId = zcontractsByClientId;
    }

    @OneToMany(mappedBy = "clientId")
    public Collection<Zdeliverylog> getZdeliverylogsByClientId() {
        return zdeliverylogsByClientId;
    }

    public void setZdeliverylogsByClientId(Collection<Zdeliverylog> zdeliverylogsByClientId) {
        this.zdeliverylogsByClientId = zdeliverylogsByClientId;
    }

    @OneToMany(mappedBy = "clientId")
    public Collection<Zinvoice> getZinvoicesByClientId() {
        return zinvoicesByClientId;
    }

    public void setZinvoicesByClientId(Collection<Zinvoice> zinvoicesByClientId) {
        this.zinvoicesByClientId = zinvoicesByClientId;
    }

    @OneToMany(mappedBy = "clientId")
    public Collection<Zorder> getZordersByClientId() {
        return zordersByClientId;
    }

    public void setZordersByClientId(Collection<Zorder> zordersByClientId) {
        this.zordersByClientId = zordersByClientId;
    }

    public TfyclientForm() {
    }

    public TfyclientForm(Integer clientId, Timestamp updateTime, String clientIndustry, String clientSource, String clientUrl, Timestamp establishPerson, Timestamp establishTime, String clientName, String clientRank, String clientPhone, String clientMobile, String clientSite, String clientRemark, String clientPeople, String clientCjpeople, int clientState, int clientIffollowup, String clientSheng, String clientSz, QempFrom empId, String clientPayattention, Collection<Tfyempoperation> operationId, Collection<TfyrelationwarnFrom> relationwarnId, Collection<TfylinkmanForm> tfylinkmanFormsByClientId, Collection<Zbarter> zbartersByClientId, Collection<Zcontract> zcontractsByClientId, Collection<Zdeliverylog> zdeliverylogsByClientId, Collection<Zinvoice> zinvoicesByClientId, Collection<Zorder> zordersByClientId) {
        this.clientId = clientId;
        this.updateTime = updateTime;
        this.clientIndustry = clientIndustry;
        this.clientSource = clientSource;
        this.clientUrl = clientUrl;
        this.establishPerson = establishPerson;
        this.establishTime = establishTime;
        this.clientName = clientName;
        this.clientRank = clientRank;
        this.clientPhone = clientPhone;
        this.clientMobile = clientMobile;
        this.clientSite = clientSite;
        this.clientRemark = clientRemark;
        this.clientPeople = clientPeople;
        this.clientCjpeople = clientCjpeople;
        this.clientState = clientState;
        this.clientIffollowup = clientIffollowup;
        this.clientSheng = clientSheng;
        this.clientSz = clientSz;
        this.empId = empId;
        this.clientPayattention = clientPayattention;
        this.operationId = operationId;
        this.relationwarnId = relationwarnId;
        this.tfylinkmanFormsByClientId = tfylinkmanFormsByClientId;
        this.zbartersByClientId = zbartersByClientId;
        this.zcontractsByClientId = zcontractsByClientId;
        this.zdeliverylogsByClientId = zdeliverylogsByClientId;
        this.zinvoicesByClientId = zinvoicesByClientId;
        this.zordersByClientId = zordersByClientId;
    }


    @Override
    public String toString() {
        return "TfyclientForm{" +
                "clientId=" + clientId +
                ", updateTime=" + updateTime +
                ", clientIndustry='" + clientIndustry + '\'' +
                ", clientSource='" + clientSource + '\'' +
                ", clientUrl='" + clientUrl + '\'' +
                ", establishPerson=" + establishPerson +
                ", establishTime=" + establishTime +
                ", clientName='" + clientName + '\'' +
                ", clientRank='" + clientRank + '\'' +
                ", clientPhone='" + clientPhone + '\'' +
                ", clientMobile='" + clientMobile + '\'' +
                ", clientSite='" + clientSite + '\'' +
                ", clientSitexq='" + clientSitexq + '\'' +
                ", clientRemark='" + clientRemark + '\'' +
                ", clientPeople='" + clientPeople + '\'' +
                ", clientCjpeople='" + clientCjpeople + '\'' +
                ", clientState=" + clientState +
                ", clientIffollowup=" + clientIffollowup +
                ", clientSheng='" + clientSheng + '\'' +
                ", clientSz='" + clientSz + '\'' +
                '}';
    }
}
